package com.example.administrator.baikangxing.holder;

import android.view.View;
import android.widget.TextView;

import com.example.administrator.baikangxing.MyApplication;
import com.example.administrator.baikangxing.R;
import com.example.administrator.baikangxing.bean.HeartBean;
import com.example.administrator.baikangxing.utils.Utils;

/**
 * Created by Sushil_Shen on 2017/5/4/0004.
 * Contact: Sushil_shen@163.com
 */

public class HeartHolder extends BaseHolder<HeartBean> {

    private TextView heart_item_time;
    private TextView heart_item_num;

    @Override
    protected View getHolderView() {
        View view = View.inflate(MyApplication.context, R.layout.heart_item_layout, null);
        heart_item_time = (TextView) view.findViewById(R.id.heart_item_tv_time);
        heart_item_num = (TextView) view.findViewById(R.id.heart_item_tv_num);
        return view;
    }

    @Override
    public void bindData(HeartBean heartBean) {
        heart_item_time.setText(heartBean.getTime()+":00");
        heart_item_num.setText(Utils.stringToInt(heartBean.getAvgheartrate())+"");
    }
}
